package com.sun.sort.select;

public class select2 {
    public static void main(String[] args) {
        int[] arr = {101,34,119,-1,2,1};

        for (int i = 0; i < arr.length - 1; i++) {
            int index = i;
            int value = arr[i];
            for (int j = i; j < arr.length ; j++) {
                if (arr[index] > arr[j]){
                    index = j;
                    value = arr[index];
                }
            }
            if (index != i){
                arr[index] = arr[i];
                arr[i] = value;
            }
        }

    }
}
